﻿using System.Globalization;
using System.Windows.Data;
using Brushes = System.Windows.Media.Brushes;
using TaskStatus = VideoTools.vo.TaskStatus;

namespace VideoTools.Converters
{

    public class TaskStatusToColorConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if(value is string str)
            {
                    return Brushes.Green;
            }else if(value is TaskStatus status)
            {
      
                    return status switch
                    {
                        TaskStatus.Pending => Brushes.Black,
                        TaskStatus.Running => Brushes.Blue,
                        TaskStatus.Completed => Brushes.Green,
                        TaskStatus.Failed => Brushes.Red,
                        _ => Brushes.Black
                    };
            }
            return Brushes.Black;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}